home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.2 KB | 39 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 1972390 20-Feb-90 23:42PST
-
- From: MUYSVASOVIC ACE - Jean-Denis Muys-Vasovic
-
- To: ALGER Alger, Jeff,VCA
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Persistent Observations
-
- Jeff,
-
- Your "owned" seems good to me, but how would you handle the situation for
- dynamically variable fields, a la TList? And how would you solve the following
- quite common situation, say in a MacDraw-like program:
-
- User clicks inside the view to create a new shape. A new TCommand is created.
- This TCommand will create the new TShape, and add it to the Document's shape
- list (a TList). Who is the owner of the shape? Now the user might choose to
- undo, in which case the shape must be freed. By whom? Usually, this problem is
- handled by the TCommand in the free method:
-
- TSketcher.Free; OVERRIDE;
- BEGIN
- IF NOT fCommandDone THEN fNewShape.Free;
- INHERITED Free;
- END;
-
- How would you adapt this scheme to your ownership assertion? I feel that
- ownership is not easy to decide. Again, the real solution seems to be automatic
- garbage collection.
-
- Regards.
-
- Jean-Denis
-
-